package com.implementacion;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ibatis.dao.client.DaoException;
import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.ibatis.sqlmap.client.SqlMapExecutor;
import com.interfaces.IPais;

public class DPais extends SqlMapDaoTemplate implements IPais {

    public DPais(DaoManager daoManager) {
        super(daoManager);
    }

    public List listar() {
    	System.out.println("listar pais");
    	List Lista = null;
        Map map = new HashMap();
        try{
        	SqlMapExecutor sqlMap = getSqlMapExecutor();	    		
        	Lista = (List)sqlMap.queryForList("LISTAPAIS", map);
        	System.out.println(Lista.size());
	    }catch(SQLException e){		
	    	System.out.println("errorrrr");
		    throw new DaoException("ERROR AL validar");
		}
        return Lista;
    }
}
